package com.lam.mall.entity;

import java.util.Date;
import java.util.List;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Null;
import javax.validation.constraints.Size;

import com.baomidou.mybatisplus.annotation.FieldFill;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.lam.common.base.domain.BaseEntity;
import com.lam.common.components.dict.annotation.Dict;
import com.lam.common.utils.DateUtil;
import com.lam.common.validate.annotation.DictCheck;
import com.lam.common.validate.annotation.DictValid;
import com.lam.common.validate.group.Add;

/**
 * 运费模板对象 mall_trans_fee_template
 * 
 * @author admin
 * @date 2023-04-21
 */
@DictCheck
@TableName("mall_trans_fee_template")
public class TransFeeTemplate implements BaseEntity{

    /** 主键 */
    @Null(groups = Add.class, message="id必须为空")
    @TableId(type = IdType.AUTO)
    private String id;
    
    /** 运费模板名称 */
    @NotBlank(message = "运费模板名称不能为空")
    @Size(max = 36, message = "运费模板名称长度不能超过36个字符")
    private String templateName;

    /** 店铺id */
    private String shopId;

    /** 收费方式（0-按件数,1-按重量,2-按体积） */
    @NotNull(message = "收费方式不能为空")
    @DictValid(message = "无效的收费方式")
    @Dict(dictCode = "charge_type")
    private Integer chargeType;

    /** 是否包邮(0-不包邮,1-包邮) */
    @NotNull(message = "是否包邮不能为空")
    @DictValid(message = "无效的是否包邮")
    @Dict(dictCode = "free_fee_type")
    private Integer isFreeFee;

    /** 是否有包邮条件(0-否,1-是) */
    @NotNull(message = "是否有包邮条件不能为空")
    @DictValid(message = "无效的是否有包邮条件")
    @Dict(dictCode = "yn10")
    private Integer hasFreeCondition;

    /** 创建人 */
    private String createBy;

    /** 创建时间 */
    @JsonFormat(pattern = DateUtil.PATTERN_DEFAULT)
    @TableField(fill = FieldFill.INSERT)
    private Date createTime;

    /** 更新人 */
    private String updateBy;

    /** 更新时间 */
    @JsonFormat(pattern = DateUtil.PATTERN_DEFAULT)
    @TableField(fill = FieldFill.UPDATE)
    private Date updateTime;
    
    /** 运费项 */
    @TableField(exist=false)
    private List<TransFeeItem> transFeeItemList;
    
    /** 指定条件包邮项 */
    @TableField(exist=false)
    private List<TransFree> transFreeList;

    public void setId(String id) {
        this.id = id;
    }

    public String getId() {
        return id;
    } 

    public void setTemplateName(String templateName) {
        this.templateName = templateName;
    }

    public String getTemplateName() {
        return templateName;
    }    
    
    public void setShopId(String shopId) {
        this.shopId = shopId;
    }

    public String getShopId() {
        return shopId;
    }    
    
    public void setChargeType(Integer chargeType) {
        this.chargeType = chargeType;
    }

    public Integer getChargeType() {
        return chargeType;
    }    
    
    public void setIsFreeFee(Integer isFreeFee) {
        this.isFreeFee = isFreeFee;
    }

    public Integer getIsFreeFee() {
        return isFreeFee;
    }    
    
    public void setHasFreeCondition(Integer hasFreeCondition) {
        this.hasFreeCondition = hasFreeCondition;
    }

    public Integer getHasFreeCondition() {
        return hasFreeCondition;
    }    
    
    public void setCreateBy(String createBy) {
        this.createBy = createBy;
    }

    public String getCreateBy() {
        return createBy;
    }    
    
    public void setCreateTime(Date createTime) {
        this.createTime = createTime;
    }

    public Date getCreateTime() {
        return createTime;
    }    
    
    public void setUpdateBy(String updateBy) {
        this.updateBy = updateBy;
    }

    public String getUpdateBy() {
        return updateBy;
    }    
    
    public void setUpdateTime(Date updateTime) {
        this.updateTime = updateTime;
    }

    public Date getUpdateTime() {
        return updateTime;
    }

	public List<TransFree> getTransFreeList() {
		return transFreeList;
	}

	public void setTransFreeList(List<TransFree> transFreeList) {
		this.transFreeList = transFreeList;
	}

	public List<TransFeeItem> getTransFeeItemList() {
		return transFeeItemList;
	}

	public void setTransFeeItemList(List<TransFeeItem> transFeeItemList) {
		this.transFeeItemList = transFeeItemList;
	}    
    

}
